package com.yunsom.testdemo.design.agent;

/**
 * @author Xbao
 * @version 1.0
 * @description
 * @date 2021/3/17 18:45
 */
public class ProxyVideo implements Video{

  private RealVideo realVideo;

  private String fileName;

  public ProxyVideo(String fileName) {
    this.fileName = fileName;
  }

  @Override
  public void display() {
    if(realVideo == null){
      realVideo = new RealVideo(fileName);
    }
    realVideo.display();
  }
}
